home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / bro / SpreadLaserA.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  2.0 KB  |  82 lines

  1. class classes.bro.SpreadLaserA
  2. {
  3.    var x;
  4.    var y;
  5.    var id;
  6.    var dir;
  7.    var num;
  8.    var clip;
  9.    var axis;
  10.    var w;
  11.    var h;
  12.    var exploX;
  13.    var exploY;
  14.    var xMov = 0;
  15.    var yMov = 0;
  16.    var power = 1;
  17.    function SpreadLaserA(px, py, pDir, pnum, pid)
  18.    {
  19.       this.x = px;
  20.       this.y = py;
  21.       this.id = pid;
  22.       this.dir = pDir;
  23.       this.num = pnum;
  24.       _root.d = _root.d + 1;
  25.       this.clip = _root.attachMovie("spreadLaserA","spreadLaserA" + this.id + "Clip",_root.d + 5000);
  26.       this.clip._x = this.x;
  27.       this.clip._y = this.y;
  28.       this.clip.id = this.id;
  29.       if(this.dir == "U")
  30.       {
  31.          this.axis = "y";
  32.          this.yMov = -20;
  33.          this.xMov = this.num != 1 ? 3 : -3;
  34.          this.y += 20;
  35.       }
  36.       else if(this.dir == "D")
  37.       {
  38.          this.axis = "y";
  39.          this.yMov = 20;
  40.          this.xMov = this.num != 1 ? 3 : -3;
  41.          this.y -= 20;
  42.       }
  43.       else if(this.dir == "R")
  44.       {
  45.          this.axis = "x";
  46.          this.yMov = this.num != 1 ? 3 : -3;
  47.          this.xMov = 20;
  48.          this.x -= 20;
  49.       }
  50.       else
  51.       {
  52.          this.axis = "x";
  53.          this.yMov = this.num != 1 ? 3 : -3;
  54.          this.xMov = -20;
  55.          this.x += 20;
  56.       }
  57.       this.clip.gotoAndStop(this.dir);
  58.       this.w = this.clip._width;
  59.       this.h = this.clip._height;
  60.       _root.stats.fired = _root.stats.fired + 1;
  61.    }
  62.    function hit()
  63.    {
  64.       _root.stats.hit = _root.stats.hit + 1;
  65.       _root.createGunExplo([this.exploX,this.exploY,_root.randRange2(50,80)]);
  66.       _root.removeBroShot("spreadLaserA" + this.id);
  67.    }
  68.    function main()
  69.    {
  70.       this.xMov *= 1.03;
  71.       this.yMov *= 1.03;
  72.       if(this.x > 1075 || this.x < -75 || this.y > 675 || this.y < -75)
  73.       {
  74.          _root.removeBroShot("spreadLaserA" + this.id);
  75.       }
  76.       this.x += this.xMov;
  77.       this.y += this.yMov;
  78.       this.clip._x = this.x;
  79.       this.clip._y = this.y;
  80.    }
  81. }
  82.